﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Microwave: Microwave.cs Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                C# examples using state machines generated by StateBuilderDotNet
            </h1>
            <h3>
                Microwave: Microwave.cs Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">Microwave.cs</div>  </div>
</div>
<div class="contents">
<a href="_microwave_8cs.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 ﻿
<a name="l00002"></a><a class="code" href="namespace_state_forge_1_1_examples_1_1_microwave.html">00002</a> <span class="keyword">namespace </span>StateForge.Examples.<a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html" title="Microwave is a container class which hold instances of a MicrowaveActuator and a generated MicrowaveC...">Microwave</a>
<a name="l00003"></a>00003 {
<a name="l00004"></a>00004     <span class="keyword">using</span> System;
<a name="l00005"></a>00005     <span class="keyword">using</span> StateForge.StateMachine;
<a name="l00006"></a>00006 
<a name="l00011"></a><a class="code" href="interface_state_forge_1_1_examples_1_1_microwave_1_1_i_microwave_actuator.html">00011</a>     <span class="keyword">public</span> interface <a class="code" href="interface_state_forge_1_1_examples_1_1_microwave_1_1_i_microwave_actuator.html">IMicrowaveActuator</a>
<a name="l00012"></a>00012     {
<a name="l00013"></a>00013         <span class="keywordtype">void</span> DoOn();
<a name="l00014"></a>00014         <span class="keywordtype">void</span> DoOff();
<a name="l00015"></a>00015     }
<a name="l00016"></a>00016 
<a name="l00020"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave_actuator.html">00020</a>     <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave_actuator.html" title="MicrowaveActuator is a concrete implementation of the IMicrowaveActuator interface.">MicrowaveActuator</a> : <a class="code" href="interface_state_forge_1_1_examples_1_1_microwave_1_1_i_microwave_actuator.html">IMicrowaveActuator</a>
<a name="l00021"></a>00021     {
<a name="l00022"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave_actuator.html#ad756de0cdd5087f314ef476d4ff09bb7">00022</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> DoOn()
<a name="l00023"></a>00023         {
<a name="l00024"></a>00024             Console.WriteLine(<span class="stringliteral">&quot;DoOn&quot;</span>);
<a name="l00025"></a>00025         }
<a name="l00026"></a>00026 
<a name="l00027"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave_actuator.html#a79987f11cef435d2fc9649c90a4887f6">00027</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> DoOff()
<a name="l00028"></a>00028         {
<a name="l00029"></a>00029             Console.WriteLine(<span class="stringliteral">&quot;DoOff&quot;</span>);
<a name="l00030"></a>00030         }
<a name="l00031"></a>00031     }
<a name="l00032"></a>00032 
<a name="l00036"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html">00036</a>     <span class="keyword">public</span> <span class="keyword">partial class </span><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html" title="Microwave is a container class which hold instances of a MicrowaveActuator and a generated MicrowaveC...">Microwave</a>
<a name="l00037"></a>00037     {
<a name="l00038"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html#a830f993a6d12aa736d543c9e304de41a">00038</a>         <span class="keyword">private</span> MicrowaveContext <a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html#a830f993a6d12aa736d543c9e304de41a">context</a>;
<a name="l00039"></a>00039 
<a name="l00040"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html#a772fe2d5c9a6a9ccebe296a3a22f3b12">00040</a>         <span class="keyword">public</span> <a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html" title="Microwave is a container class which hold instances of a MicrowaveActuator and a generated MicrowaveC...">Microwave</a>()
<a name="l00041"></a>00041         {
<a name="l00042"></a>00042             this.context = <span class="keyword">new</span> MicrowaveContext(<span class="keyword">this</span>);
<a name="l00043"></a>00043             this.context.Observer = ObserverConsole.Instance;
<a name="l00044"></a>00044             this.context.EnterInitialState();
<a name="l00045"></a>00045         }
<a name="l00046"></a>00046 
<a name="l00047"></a>00047         <span class="keyword">public</span> IObserver Observer
<a name="l00048"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html#ae99f217996b62972aacb81517f5edefb">00048</a>         {
<a name="l00049"></a>00049             <span class="keyword">get</span>
<a name="l00050"></a>00050             {
<a name="l00051"></a>00051                 <span class="keywordflow">return</span> this.context.Observer;
<a name="l00052"></a>00052             }
<a name="l00053"></a>00053             <span class="keyword">set</span>
<a name="l00054"></a>00054             {
<a name="l00055"></a>00055                 this.context.Observer = value;
<a name="l00056"></a>00056             }
<a name="l00057"></a>00057         }
<a name="l00058"></a>00058 
<a name="l00059"></a><a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html#a1d9478cd705f6db10d3d323a5e6ab462">00059</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> Main(<span class="keywordtype">string</span>[] args)
<a name="l00060"></a>00060         {
<a name="l00061"></a>00061             <a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html" title="Microwave is a container class which hold instances of a MicrowaveActuator and a generated MicrowaveC...">Microwave</a> microwave = <span class="keyword">new</span> <a class="code" href="class_state_forge_1_1_examples_1_1_microwave_1_1_microwave.html" title="Microwave is a container class which hold instances of a MicrowaveActuator and a generated MicrowaveC...">Microwave</a>();
<a name="l00062"></a>00062             microwave.EvStart();
<a name="l00063"></a>00063             microwave.EvDoorOpened();
<a name="l00064"></a>00064             microwave.EvTurnOn();
<a name="l00065"></a>00065             microwave.EvDoorClosed();
<a name="l00066"></a>00066             microwave.EvDoorClosed();
<a name="l00067"></a>00067             microwave.EvCookingDone();
<a name="l00068"></a>00068             microwave.EvDoorOpened();
<a name="l00069"></a>00069             microwave.EvTurnOff();
<a name="l00070"></a>00070             microwave.EvDoorOpened();
<a name="l00071"></a>00071             microwave.EvTurnOn();
<a name="l00072"></a>00072             microwave.EvDoorClosed();
<a name="l00073"></a>00073 
<a name="l00074"></a>00074             Environment.Exit(0);
<a name="l00075"></a>00075         }
<a name="l00076"></a>00076     }
<a name="l00077"></a>00077 }
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
